package Day24;

public class Text {
    public static void main(String[] args) {
        Manger m = new Manger("tom",2300,5000);
        Worker w = new Worker("jane",2500);
        Text t = new Text();
        t.showEmpAnnual(m);
        t.showEmpAnnual(w);
        t.textWork(m);
        t.textWork(w);

    }

    public void  showEmpAnnual(Employee e){
        System.out.println(e.getAnnual());
    }

    public void textWork(Employee e){
        if(e instanceof Manger){
            Manger m = ((Manger) e);
            m.manage();
        }else if(e instanceof Worker){
            Worker w = ((Worker)e);
            w.Work();
        }else{
            System.out.println("没有该类型");
        }
    }
}
